import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/ShuManagement/Manage.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'login',
    redirect:"/login",
  },
  {
    path: '/Manage',
    name: 'Manage',
    component: () => import('../views/ShuManagement/Manage.vue'),
    redirect:"/home",
    children: [
      {
        path: 'home', name: 'Home', component: () => import('../views/ShuManagement/Home.vue')
      },
        //公告声明
      {
        path: 'announcement', name: 'Announcement', component: () => import('../views/ShuManagement/Announcement.vue')
      },
        //系统管理
      {
        path: 'user', name: 'User', component: () => import('../views/ShuManagement/User.vue')
      },
      {
        path: 'userInfo', name: 'userInfo', component: () => import('../views/ShuManagement/userInfo.vue')
      },
        //**订水管理**//
        //订单管理
      {
        path:'Water/OrderManagement', name:'WaterOrderManagement', component:()=>import('../views/ShuManagement/Water/OrderManagement.vue')
      },
      {
        path:'Water/CommodityManagement', name:'WaterCommodityManagement', component:()=>import('../views/ShuManagement/Water/CommodityManagement.vue')
      },
      {
        path:'Water/PublicAnnouncement', name:'WaterPublicAnnouncement', component:()=>import('../views/ShuManagement/Water/PublicAnnouncement.vue')
      },
      {
        path:'Water/StatisticalChart', name:'WaterStatisticalChart', component:()=>import('../views/ShuManagement/Water/StatisticalChart.vue')
      },
      //  电费管理
      //1. 缴费管理
      {
        path:'Electricity/PaymentManagement', name:'ElectricityPaymentManagement',component:()=>import('../views/ShuManagement/Electricity/PaymentManagement.vue')
      },
    ]
  },
  {
    path:'/login',
    name:'Login',
    component:()=>import('../views/Login.vue')
  },
  {
    path:'/register',
    name:'Register',
    component:()=>import('../views/Register.vue')
  },
  {
    path: '/App',
    name: 'App',
    component: () => import('../views/ShuApplication/Application.vue'),
    redirect:"/home",
    children: [
      {
        path: 'home', name: 'Home', component: () => import('../views/ShuApplication/Home.vue')
      }
      ,
      {
        path:'Water/OrderWater' ,
        name: "OrderWaterApplication",
        component:()=>import('../views/ShuApplication/AppWater/OrderWater.vue')
      },
      {
        path: 'Water/HistoryOrder',
        name: "HistoryWaterOrderApplication",
        component: () => import('../views/ShuApplication/AppWater/HistoryOrder.vue')
      },
      {
        path: 'Electric/ElectricPay',
        name: "ElectricPayApplication",
        component: () => import('../views/ShuApplication/AppElectric/ElectricPay.vue')
      },
      {
        path: 'Electric/HistoryOrder',
        name: "HistoryElectricPayApplication",
        component: () => import('../views/ShuApplication/AppElectric/HistoryOrder.vue')
      },
      {
        path: 'announcement',
        name: 'Announcement',
        component: () => import('../views/ShuApplication/Announcement.vue')
      },
      {
        path: 'info',
        name: "infoApplication",
        component: () => import('../views/ShuApplication/userinfo.vue')
      }
    ]
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
